package com.qeado.content.dao.ibatis;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.qeado.common.dao.BaseDao;
import com.qeado.content.dao.MessageBoardDao;
import com.qeado.content.model.MessageBoard;

@Repository
public class MessageBoardDaoImpl extends BaseDao implements MessageBoardDao {

	@Override
	public void deleteMessageBoard(String id) {
		this.getSqlMapClientTemplate().delete("deleteMessageBoard", id);
	}

	@Override
	public void saveMessageBoard(MessageBoard messageBoard) {
		this.getSqlMapClientTemplate().update("saveMessageBoard", messageBoard);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<MessageBoard> searchMessageBoard(MessageBoard messageBoard) {
		return this.getSqlMapClientTemplate().queryForList("searchMessageBoard", messageBoard);
	}

	@Override
	public MessageBoard searchMessageBoardById(String id) {
		return (MessageBoard) this.getSqlMapClientTemplate().queryForObject("searchMessageBoardById", id);
	}

}
